<!-- thanh toolbar -->
<?php $this->placeholder('toolbar')->captureStart();?>
<?php echo $this->partial('index/toolbar/save-order.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/publish.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/unpublish.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/new.phtml', 'admin', array($this->url(array('action' => 'insert')))) ?>
<?php echo $this->partial('index/toolbar/edit.phtml', 'admin', array($this->url(array('action' => 'update')))) ?>
<?php echo $this->partial('index/toolbar/divider.phtml', 'admin') ?>
<?php echo $this->partial('index/toolbar/trash.phtml', 'admin', array($this->url(array('action' => 'delete')))) ?>
<?php $this->placeholder('toolbar')->captureEnd();?>
<!-- / --> 

<form id='adminForm' name='adminForm' method='post' action=''>

	<!-- phần tìm kiếm -->
	<fieldset id='filter-bar' style='height: auto'>
		<?php echo $this->partial('index/search/layout.phtml', 'admin',array (  	
			 $this->partial('index/search/search.phtml', 'admin',array('label'=>$this->captions,'value'=>$this->product_code,'name'=>'product_code')),
			 $this->partial('index/search/search.phtml', 'admin',array('label'=>$this->captions,'value'=>$this->product_name,'name'=>'product_name')),
			 $this->partial('index/search/submit.phtml', 'admin') 
		 )); ?>		 
		<?php echo $this->partial('index/filter/layout.phtml', 'admin',array (	
			$this->partial('index/filter/publish.phtml', 'admin',array('name'=>'product_status','value'=>$this->product_status)) 
		 )); ?>
		 <?php /*echo $this->partial('index/group/layout.phtml', 'admin',array (
		 	'data'=>array(0=>"Nhóm hàng hóa"),"value"=>$this->group_keyword
		 ));*/ ?>
	</fieldset>	
	<!-- / -->
	
	<!-- danh sách hiển thị -->
	<div class='clr'> </div>
	<table class='adminlist'>
		<thead>			
			<tr>
				<?php echo $this->partial('index/manage/no-save-order.phtml', 'admin', array('column'=>'product_order')); ?>
				<?php echo $this->partial('index/manage/checkbox-all.phtml', 'admin'); ?>				
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_code')); ?>
				</th>
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_name')); ?>
				</th>
				
				<!--
				<?php if($this->group_keyword!="0"){?>
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_product_group_code')); ?>
				</th>
				<?php }?>				
				
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_type')); ?>
				</th>
				
				
				<?php if($this->group_keyword!="1"){?>
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_warehouse_group_code')); ?>
				</th>
				<?php }?>

				<!--<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_unit_change_code')); ?>
				</th>				
				
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_instore_max')); ?>
				</th>
				
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_instore_min')); ?>
				</th>-->
				
				<th>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_note')); ?>
				</th>				
				
				<th width='80px'>
					<?php echo $this->partial('index/manage/header.phtml','admin',array('caption'=>$this->captions,'column'=>'product_status')); ?>
				</th>
				<th width='80px'>
					Quản lý
				</th>
			</tr>
		</thead>
		<tbody>
		<?php if (count($this->paginator) > 0): $no=0;$flag="";?>
		<?php foreach ($this->paginator as $row): ?>
		
			<?php 
			/*switch ($this->group_keyword)
			{
				case 1:
					if($flag!=$row->product_warehouse_group_code)
					{
						$flag=$row->product_warehouse_group_code;
			?>
					<tr>
						<td colspan='12' style='color:blue;font-weight: bold;text-transform: uppercase;'>
							<?php echo "Nhóm kho: ".$flag." - ".$row->m_Array['warehouse_group_name'];;?>	
						</td>				
					</tr>
			<?php 	
					}
					break;
				case "0":
					if($flag!=$row->product_product_group_code)
					{
						$flag=$row->product_product_group_code;
					?>
					<tr>
						<td colspan='12' style='color:blue;font-weight: bold;text-transform: uppercase;'>
							<?php echo "Nhóm hàng hóa: ".$flag." - ".$row->m_Array['product_group_name'];?>	
						</td>				
					</tr>
					<?php 	
					}
					break;
				default:
					break;
			}*/
			?>
			
			<tr class='row<?php echo ($no++)%2 ?>'>
				<?php echo $this->partial('index/manage/order.phtml', 'admin', array($no)) ?>
				<?php echo $this->partial('index/manage/checkbox.phtml', 'admin', array($row->product_id)) ?>
				<td class="is_code">
					<?php echo $row->product_code ?>
				</td>
				<td>
					<?php echo $row->product_name ?>
				</td>
				
				<!--
				<?php if($this->group_keyword!="0"){?>
				<td class='left'>
					<?php echo $row->m_Array['product_group_name']; ?>
				</td>
				<?php }?>
				
				<td class='left'>
					<?php echo Zend_Registry::get('product')->product_type->{$row->product_type}; ?>
				</td>
				
				<?php if($this->group_keyword!="1"){?>
				<td class='left'>
					<?php echo $row->product_warehouse_group_code; ?>
				</td>
				<?php }?>
				<td class='left'>
					<?php echo $row->product_unit_change_code ?>
				</td>			
				<td class='right'>
					<?php if($row->product_instore_min>-1){?>
					<?php echo $this->partial('index/format/float.phtml','admin',array($row->product_instore_max)); ?>
					<?php }?>
				</td>
				<td class='right'>
					<?php if($row->product_instore_min>-1){?>
					<?php echo $this->partial('index/format/float.phtml','admin',array($row->product_instore_min)); ?>
					<?php }?>
				</td>-->
				
				<td class='left'>
					<?php echo $row->product_note; ?>
				</td>
				<td class='center'>
					<?php echo $this->partial('index/manage/publish.phtml','admin', array($this->url(array('action' => 'publish')),$row->product_status)); ?>	
				</td>
				<td class='center'>
					<?php echo $this->partial('index/manage/detail.phtml','admin', array($this->url(array('action' => 'detail','id'=>$row->product_id)))); ?>				
					<?php echo $this->partial('index/manage/edit.phtml','admin', array($this->url(array('action' => 'update','id'=>$row->product_id)))); ?>
					<?php echo $this->partial('index/manage/trash.phtml','admin', array($this->url(array('action' => 'delete')))); ?>	
				</td>
			</tr>
		<?php endforeach; ?>
		<?php endif; ?>
		</tbody>
		<tfoot>
			<tr>
				<td colspan='14'>
					<div class='container'>
						<?php echo $this->paginationControl($this->paginator) ?>
					</div>
				</td>
			</tr>
		</tfoot>
	</table>
	<!-- / -->
	
</form>